﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WS.EKA.ServiceInterface;
using WS.EKA.Core.DI;
using WS.EKA.Model;
using WS.EKA.Portal.Filters;

namespace WS.EKA.Portal.Controllers
{
    [AuthencationFilter(true)]
    public class ProductCatagoryController : ApiController
    {
        private IServiceFactory factory;
        private IProductCatagory productCatagory;

        public ProductCatagoryController(IServiceFactory factory)
        {
            this.factory = factory;
            productCatagory = factory.GetInterfaceImplement<IProductCatagory>();
        }

        // GET api/productcatagory/5
        public List<ProductCatagory> Get(int id)
        {
            var list = productCatagory.GetCatagoryByFatherID(id);
            return list;
        }
    }
}
